from flask import request
from flask import render_template
from werkzeug.utils import secure_filename
import os
from app.handle.v1 import api

FILE_FOLDER = '/home/l-b/prj/FileRev'

@api.route('/index', methods=['POST', 'GET'])
def upload():
    if request.method == 'POST':
        if request.files != None:
            file = request.files['file']
            filename = secure_filename(file.filename)
            print(filename)
            file.save(os.path.join(FILE_FOLDER,filename))
            return("file upload successfully")
    return render_template('upload.html')
